package com.explorati.design_pattern.structural.facade;

//应用层不要和子系统发生交互
public class GiftExchangeService {

	private QualityService qualityService = new QualityService();
	private PointPaymentService pointPaymentService = new PointPaymentService();
	private ShippingService shippingService = new ShippingService();

	public void giftExchange(PointGift pointGift) {
		if (qualityService.isAvailable(pointGift)) {
			// 资格校验通过
			if (pointPaymentService.pay(pointGift)) {
				// 如果支付积分成功
				String shippingOrderNo = shippingService.shipGift(pointGift);
				System.out.println("物流系统下单成功" + shippingOrderNo);
			}
		}
	}

}
